<template>
  <div class='lt-home-page'>
    <!-- 轮播图 -->
    <HomeBanner/>

    <!-- 最近浏览 -->
    <Collect :urlList="urlList" v-if="urlList.length>0"/>

    <!-- 推荐 -->
    <HomeSuggest/>

    <!-- 精彩文章 -->
    <HomeWonderful/>

    <!-- 艺术家 -->
    <HomeArtist/>

    <!-- 分类 -->
    <HomeClassification/>
  </div>
  </template>

<script>
import HomeBanner from './components/home-banner.vue'
import HomeSuggest from './components/home-suggest.vue'
import HomeWonderful from './components/home-wonderful.vue'
import HomeArtist from './components/home-artist.vue'
import HomeClassification from './components/home-classification.vue'
import Collect from './components/collect.vue'
import { onMounted, ref } from 'vue'
import { useStore } from 'vuex'
import { findUserInfo } from '@/api/user'
export default {
  name: 'lt-home-page',
  components: {
    HomeBanner,
    HomeSuggest,
    HomeWonderful,
    HomeArtist,
    HomeClassification,
    Collect
  },
  setup () {
    const store = useStore()
    const urlList = ref([])
    onMounted(() => {
      findUserInfo({ userName: store.state.user.profile.userName }).then(res => {
        // console.log(res)
        urlList.value = res.data
      })
    })
    return { urlList }
  }
}
</script>

<style scoped lang='less'>
</style>
